from flask import Flask,render_template,request

app = Flask(__name__)

@app.route("/")
def hello() -> str:
    return "Hello world from Flask!"

@app.route("/pick_color",methods=["POST"])
def pick_color()->"html":
    the_color1 = request.form["user_color1"]
    the_color2 = request.form["user_color2"]
    title = "这是宁选择的两种颜色："
    return render_template("results.html",
                           the_title=title,
                           the_color1=the_color1,
                           the_color2=the_color2)


@app.route("/entry")
def entry_page() -> "html":
    return render_template("entry.html",
                           the_title="欢迎来到线上选色~")

if __name__=="__main__":
    app.run(debug=True)